<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sales Alert!</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 600px;">
  <tr>
    <td align="left"><img src="cid:logo" alt="<?php echo $this->escape($this->systemSetting->companyName); ?>" style="border: none;" ></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
      <td align="left"><b>Sales Alert!</b></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left" style="background-color: #069; color:#FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;">Sales Information</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left">
        <b>Invoice No:</b> <span style="color: #069; font-weight: bold;"><?php echo $this->systemSetting->invoicePrefix . sprintf('%0'.$this->systemSetting->invoiceNumberThreshold.'d', $this->sale->invoiceId) . $this->systemSetting->invoiceSuffix; ?></span><br />
        <b>Sale Id:</b> <span style="color: #069; font-weight: bold;"><?php echo $this->sale->saleId; ?></span><br />
        <b>Date Sold:</b> <span style="color: #069; font-weight: bold;"><?php echo date("d-M-Y", strtotime($this->sale->dateSold)); ?></span><br >
	<br />
        <?php if($this->sale->customerName): ?>
        <b>Customer Name:</b> <?php echo $this->escape($this->sale->customerName); ?><br />
        <?php endif; ?>

        <?php if($this->sale->customerAddress): ?>
        <b>Customer Address:</b> <?php echo nl2br($this->escape($this->sale->customerAddress)); ?><br />
        <?php endif; ?>

        <?php if($this->sale->customerPhone): ?>
        <b>Customer Phone No:</b> <?php echo $this->escape($this->sale->customerPhone); ?>
        <?php endif; ?>
	</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left">
        <table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: #000000;">
        <tr style="background-color: #CCCCCC;">
          <th align="left" style="width: 15%; padding: 0.3em; color: #FFFFFF;">Product</th>
          <th align="right" style="width: 15%; padding: 0.3em; color: #FFFFFF;">Quantity</th>
          <th align="right" style="width: 15%; padding: 0.3em; color: #FFFFFF;">Unit Price</th>
          <th align="right" style="width: 20%; padding: 0.3em; color: #FFFFFF;">Amount</th>
        </tr>
         <?php foreach ($this->products as $product): ?>
        <tr style="background-color: #EEEEEE; text-align: center;">
          <td align="left"><?php echo $this->escape($product->name); ?></td>
          <td align="right"><?php echo $product->quantity; ?></td>
          <td align="right"><?php echo number_format($product->unitPrice, 2, '.', ','); ?></td>
          <td align="right"><?php echo number_format($product->total, 2, '.', ','); ?></td>
        </tr>
        <?php endforeach; ?>
        <tr style="text-align: right;">
          <td colspan="2">&nbsp;</td>
          <td style="background-color: #EEEEEE; font-weight: bold; padding: 0.3em;">Total</td>
          <td style="background-color: #EEEEEE; padding: 0.3em;"><?php echo $this->escape($this->systemSetting->currencySymbol) . number_format($this->sale->total, 2, '.', ','); ?></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left" style="background-color: #069; color: #FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center" style="font-size: 11px; border-top: 1px solid #069;"><span style="color: #069; font-weight: bold;"><?php echo $this->escape($this->systemSetting->companyName); ?></span> Powered By <a href="http://www.paceplux.com" style="text-decoration: none; color: #374953;">PacePlux Inc.</a></td>
  </tr>
</table>
</body>
</html>